<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
BSPTree.LeafMerger (Commons Math 3.2 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="BSPTree.LeafMerger (Commons Math 3.2 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/BSPTree.LeafMerger.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.html" title="class in org.apache.commons.math3.geometry.partitioning"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTreeVisitor.html" title="interface in org.apache.commons.math3.geometry.partitioning"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?org/apache/commons/math3/geometry/partitioning/BSPTree.LeafMerger.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="BSPTree.LeafMerger.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.commons.math3.geometry.partitioning</FONT>
<BR>
Interface BSPTree.LeafMerger&lt;S extends <A HREF="../../../../../../org/apache/commons/math3/geometry/Space.html" title="interface in org.apache.commons.math3.geometry">Space</A>&gt;</H2>
<DL>
<DT><DT><B>Type Parameters:</B><DD><CODE>S</CODE> - Type of the space.</DL>
<DL>
<DT><B>Enclosing class:</B><DD><A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.html" title="class in org.apache.commons.math3.geometry.partitioning">BSPTree</A>&lt;<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.html" title="type parameter in BSPTree">S</A> extends <A HREF="../../../../../../org/apache/commons/math3/geometry/Space.html" title="interface in org.apache.commons.math3.geometry">Space</A>&gt;</DD>
</DL>
<HR>
<DL>
<DT><PRE>public static interface <B>BSPTree.LeafMerger&lt;S extends <A HREF="../../../../../../org/apache/commons/math3/geometry/Space.html" title="interface in org.apache.commons.math3.geometry">Space</A>&gt;</B></DL>
</PRE>

<P>
This interface gather the merging operations between a BSP tree
 leaf and another BSP tree.
 <p>As explained in Bruce Naylor, John Amanatides and William
 Thibault paper <a
 href="http://www.cs.yorku.ca/~amana/research/bsptSetOp.pdf">Merging
 BSP Trees Yields Polyhedral Set Operations</a>,
 the operations on <A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.html" title="class in org.apache.commons.math3.geometry.partitioning"><CODE>BSP trees</CODE></A> can be expressed as a
 generic recursive merging operation where only the final part,
 when one of the operand is a leaf, is specific to the real
 operation semantics. For example, a tree representing a region
 using a boolean attribute to identify inside cells and outside
 cells would use four different objects to implement the final
 merging phase of the four set operations union, intersection,
 difference and symmetric difference (exclusive or).</p>
<P>

<P>
<HR>

<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.html" title="class in org.apache.commons.math3.geometry.partitioning">BSPTree</A>&lt;<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.LeafMerger.html" title="type parameter in BSPTree.LeafMerger">S</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.LeafMerger.html#merge(org.apache.commons.math3.geometry.partitioning.BSPTree, org.apache.commons.math3.geometry.partitioning.BSPTree, org.apache.commons.math3.geometry.partitioning.BSPTree, boolean, boolean)">merge</A></B>(<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.html" title="class in org.apache.commons.math3.geometry.partitioning">BSPTree</A>&lt;<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.LeafMerger.html" title="type parameter in BSPTree.LeafMerger">S</A>&gt;&nbsp;leaf,
      <A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.html" title="class in org.apache.commons.math3.geometry.partitioning">BSPTree</A>&lt;<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.LeafMerger.html" title="type parameter in BSPTree.LeafMerger">S</A>&gt;&nbsp;tree,
      <A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.html" title="class in org.apache.commons.math3.geometry.partitioning">BSPTree</A>&lt;<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.LeafMerger.html" title="type parameter in BSPTree.LeafMerger">S</A>&gt;&nbsp;parentTree,
      boolean&nbsp;isPlusChild,
      boolean&nbsp;leafFromInstance)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Merge a leaf node and a tree node.</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="merge(org.apache.commons.math3.geometry.partitioning.BSPTree, org.apache.commons.math3.geometry.partitioning.BSPTree, org.apache.commons.math3.geometry.partitioning.BSPTree, boolean, boolean)"><!-- --></A><H3>
merge</H3>
<PRE>
<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.html" title="class in org.apache.commons.math3.geometry.partitioning">BSPTree</A>&lt;<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.LeafMerger.html" title="type parameter in BSPTree.LeafMerger">S</A>&gt; <B>merge</B>(<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.html" title="class in org.apache.commons.math3.geometry.partitioning">BSPTree</A>&lt;<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.LeafMerger.html" title="type parameter in BSPTree.LeafMerger">S</A>&gt;&nbsp;leaf,
                 <A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.html" title="class in org.apache.commons.math3.geometry.partitioning">BSPTree</A>&lt;<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.LeafMerger.html" title="type parameter in BSPTree.LeafMerger">S</A>&gt;&nbsp;tree,
                 <A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.html" title="class in org.apache.commons.math3.geometry.partitioning">BSPTree</A>&lt;<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.LeafMerger.html" title="type parameter in BSPTree.LeafMerger">S</A>&gt;&nbsp;parentTree,
                 boolean&nbsp;isPlusChild,
                 boolean&nbsp;leafFromInstance)</PRE>
<DL>
<DD>Merge a leaf node and a tree node.
 <p>This method is called at the end of a recursive merging
 resulting from a <code>tree1.merge(tree2, leafMerger)</code>
 call, when one of the sub-trees involved is a leaf (i.e. when
 its cut-hyperplane is null). This is the only place where the
 precise semantics of the operation are required. For all upper
 level nodes in the tree, the merging operation is only a
 generic partitioning algorithm.</p>
 <p>Since the final operation may be non-commutative, it is
 important to know if the leaf node comes from the instance tree
 (<code>tree1</code>) or the argument tree
 (<code>tree2</code>). The third argument of the method is
 devoted to this. It can be ignored for commutative
 operations.</p>
 <p>The <A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.html#insertInTree(org.apache.commons.math3.geometry.partitioning.BSPTree, boolean)"><CODE>BSPTree.insertInTree</CODE></A> method
 may be useful to implement this method.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>leaf</CODE> - leaf node (its cut hyperplane is guaranteed to be
 null)<DD><CODE>tree</CODE> - tree node (its cut hyperplane may be null or not)<DD><CODE>parentTree</CODE> - parent tree to connect to (may be null)<DD><CODE>isPlusChild</CODE> - if true and if parentTree is not null, the
 resulting tree should be the plus child of its parent, ignored if
 parentTree is null<DD><CODE>leafFromInstance</CODE> - if true, the leaf node comes from the
 instance tree (<code>tree1</code>) and the tree node comes from
 the argument tree (<code>tree2</code>)
<DT><B>Returns:</B><DD>the BSP tree resulting from the merging (may be one of
 the arguments)</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/BSPTree.LeafMerger.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTree.html" title="class in org.apache.commons.math3.geometry.partitioning"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../org/apache/commons/math3/geometry/partitioning/BSPTreeVisitor.html" title="interface in org.apache.commons.math3.geometry.partitioning"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?org/apache/commons/math3/geometry/partitioning/BSPTree.LeafMerger.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="BSPTree.LeafMerger.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2003-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
